package org.wisdom.ac.domain.resource.entity;

import java.util.List;

import javax.persistence.*;

import org.springframework.core.annotation.Order;

import lombok.*;

/**
 * 系统应用组件
 *
 * @author zhangzhiyan
 * @date 2022/04/29 10:00
 **/
@SuppressWarnings("JpaDataSourceORMInspection")
@EqualsAndHashCode(callSuper = true)
@Entity
@DiscriminatorValue(value = "3")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
public class AcAppWidget extends AcResource {
    /** 所属应用ID */
    @Order(1)
    @Column(nullable = false)
    private String appId;

    /** 组件包含的服务接口 */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "appWidgetId")
    private List<AcAppWidgetFacade> appWidgetFacades;
}